AndroidLinkResources and Styleables - #7306
Merged
Merged
Conversation
dellis1972
force-pushed
the
resourcelinkermk2
branch
3 times, most recently
from
August 25, 2022 13:35
0c48b3e to
47741c8
Compare
dellis1972
force-pushed
the
resourcelinkermk2
branch
2 times, most recently
from
September 5, 2022 12:03
ffd25ed to
7065651
Compare
dellis1972
marked this pull request as ready for review
September 7, 2022 09:57
dellis1972
force-pushed
the
resourcelinkermk2
branch
from
September 7, 2022 09:57
1bcb40f to
e9f9259
Compare
dellis1972
force-pushed
the
resourcelinkermk2
branch
from
September 12, 2022 10:26
98d0c45 to
d1e776a
Compare
Fixes https://b.azdo.io/6600761 Clean up code
dellis1972
force-pushed
the
resourcelinkermk2
branch
from
September 12, 2022 10:26
d1e776a to
5ee172c
Compare
jonathanpeppers
approved these changes
Sep 12, 2022
grendello
added a commit
to grendello/xamarin-android
that referenced
this pull request
Sep 14, 2022
* main: [Xamarin.Android.Build.Tasks] Add AndroidPackagingOptionsExclude (dotnet#7356) [linker] preserve Java interfaces on non-bound Java types (dotnet#7204) [Xamarin.Android.Build.Tasks] AndroidLinkResources and Styleables (dotnet#7306)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7194
Context dotnet/maui#7038
The initial version of
AndroidLinkResourcescommited in 9e6ce03 was to broad in its removal of Fields.Certain field usage like
Styleablearrays were not called using the ILstsfldop code. As a result they couldnot be easily replaced with constant usage. However the linker removed ALL the fields from the
Resourcesub classes. This would result in the following error
System.BadImageFormatException: 'Could not resolve field token 0x0400000b'.This was because the
int[]fields were removed as part of the linking process.So to fix this we need to leave the
int[]fields in theResourcesubclasses and not remove them. We canstill remove all the other
intfields though. We now also need to fix up theResourcesubclass constructorsto replace the
intfield access with the constant values like we do for the rest of the app.This was not required because because these constructors were removed. But now we have to keep them because
the static array initialisation takes place in these constructors.